package myky.com.doctorapp.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * @author Mr.li
 */
public class TabViewPagerAdapter extends FragmentPagerAdapter {
    private List<Fragment> fragments;
    private List<String> tabLists;

    public TabViewPagerAdapter(FragmentManager fm, List<Fragment> fragments, List<String> tabLists) {
        super(fm);
        this.fragments = fragments;
        this.tabLists = tabLists;
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return tabLists.get(position);
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }
}